﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;

namespace Chinaer.UI.MVC.Filters
{
    public class ValidateLoginAttribute:ActionFilterAttribute
    {
        public override void OnActionExecuting(ActionExecutingContext filterContext)
        {
            if (filterContext.HttpContext.Session["apiToken"] == null)
            {

                string path = filterContext.HttpContext.Request.Url.Authority;
                filterContext.HttpContext.Response.Redirect( "/login");
            }

        }
    }
}